<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?>
<?php $this->load->view('common/head'); ?>

<?php $this->load->view('common/header'); ?>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <?php $this->load->view('common/sidebar'); ?>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <?php $this->load->view('common/breadcrumbs'); ?>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">

                <?php $this->load->view('common/set'); ?>

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <form class="form-horizontal" id="form" method="post"
                              action="<?php echo site_url(X_URL . 'CarSeat/update'); ?>">
                            <input name="seat_id" type="hidden" value="<?php if (isset($seat)) {
                                echo $seat["id"];
                            } ?>">
                            <?php echo csrf_hidden(); ?>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 车辆等级 </label>
                                <div class="col-sm-9">
                                    <select id="car_level" name="car_level" class="col-xs-10 col-sm-5 select2">
                                        <?php if (isset($car_level)) { ?>
                                            <?php foreach ($car_level as $key => $val) { ?>
                                                <option value="<?php echo $key;?>" <?php if (isset($seat) && $seat['car_level'] == $key){ ?>selected="selected"<?php } ?> ><?php echo $val; ?>
                                                </option>
                                            <?php } ?>
                                        <?php } ?>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 车辆坐席 </label>
                                <div class="col-sm-9">
                                    <input type="number" name="car_seat" id="car_seat" placeholder="车辆坐席"
                                           class="col-xs-10 col-sm-5" value="<?php if (isset($seat)) {
                                        echo $seat["car_seat"];
                                    } ?>">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">请填写数字</span>
											</span>
                                </div>
                            </div>
                            <div class="col-md-offset-2 col-md-9">
                                <button class="btn btn-info submit" type="button">
                                    <i class="icon-ok bigger-110"></i>
                                    提交
                                </button>

                                &nbsp; &nbsp; &nbsp;
                                <button class="btn" type="reset">
                                    <i class="icon-undo bigger-110"></i>
                                    重置
                                </button>
                            </div>
                        </form>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    </div><?php $this->load->view('common/footer'); ?>



<?php $this->load->view('common/footerjs'); ?>
<!-- inline scripts related to this page -->
<script type="text/javascript">
    $(function () {
        $(".btn-info.submit").click(function () {
            var webname = $("#webname").val();
            var url = $("#url").val();
            if (webname == 0) {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "标题必须选择。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            if (url == '') {
                bootbox.dialog({
                    title: '友情提示：',
                    message: "链接地址必须填写。",
                    buttons: {
                        "success": {
                            "label": "确定",
                            "className": "btn-danger"
                        }
                    }
                });
                return;
            }
            $("#form").submit();
        });
    });
    $(".CarSeatCheck").click(function () {
        var val = $(this).val();
        if (val == 2) {
            $(".CarSeatValue").hide();
        } else {
            $(".CarSeatValue").show();
        }
    });
</script>
</body>
</html>
